<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ko">
<head>
	<title>페이지뷰</title>
	<script src="/js/jquery.js" type="text/javascript"></script>
	<script type="text/javascript">
		function setTotalVisit()
		{
			$.ajax(
			{
				type : "GET"
				, async : true
				, url : "/common/stats_total.do"
				, dataType : "html"
				, timeout : 30000
				, cache : false  //true, false
				, data : "site=home"
				, csontentType: "application/x-www-form-urlencoded; charset=UTF-8"
				, error : function(request, status, error) {
					alert("code : " + request.status + "\r\nmessage : " + request.reponseText);
				}
				, success : function(response, status, request) {
					$('#totalVisit').find("table").remove().end().append(response);
				}
			});
		}
		
		function setBBSStatics()
		{
			$.ajax(
			{
				type : "GET"
				, async : true
				, url : "/common/stats_bbsreg.do"
				, dataType : "html"
				, timeout : 30000
				, cache : false  //true, false
				, data : ""
				, contentType: "application/x-www-form-urlencoded; charset=UTF-8"
				, error : function(request, status, error) {
					alert("code : " + request.status + "\r\nmessage : " + request.reponseText);
				}
				, success : function(response, status, request) {
					$('#detailData').find("div").remove();
					$('#detailData').find("table").remove();
					$('#detailData').end();
					$('#detailData').append(response);
				}
			});
		}
		
		function downloadExcel(site, tableName, days, title)
		{
			var form = document.forms["excelDownloadFrm"];
			form.submit();
			
			return true;
		}
	</script>
</head>

<body>
	<!-- 본문 영역 -->
	<form name="excelDownloadFrm" method="post" action="/stats/excel_download.do" >
	<input type="hidden" name="tableName" value="bbs"/>
	<input type="hidden" name="title" value="stats_bbs"/>	
	<input type="hidden" name="site" />
	<input type="hidden" name="input_date" />
	</form>
	<div id="contents">
		<!-- 제목 및 Location 영역 -->
		<div id="location">
			<h3>게시판별</h3>
			<div>홈 &gt; 관리메뉴 &gt; 통계 &gt;<strong>게시판별</strong></div>
		</div>

		<!-- 본문 내용 -->
		<div id="content">
			<div id="totalVisit">
				<script>setTotalVisit();</script>
			</div>
			<div id="detailData">
				<script>setBBSStatics();</script>
			</div>
		</div>
	</div>
</body>
</html>